#pragma once

#include <stdio.h>
#include <stdlib.h>

//掌握最基本数据结构的定义框架，使用复用思维进行编程
//定义多项式结构体
typedef struct Node {
    struct {
        int xishu;
        int zhishu;
    };
    struct Node* next;
} Node, *pNode, *Polynomial;

void InitPolynomial(Polynomial p);

int GetLength(Polynomial p);

void AddNode(Polynomial p, int xishu, int zhishu);

void ClearPolynomial(Polynomial p);

long getValue(const Polynomial p, int x);

void AddPolynomial(const Polynomial p1, const Polynomial p2);

void PrintPolynomial(const Polynomial p);

void TestPolynomial();